package jwr.basic;

import java.util.Scanner;

public class NumberPiramid {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int num, i, j, cnt, min, max;
		
		System.out.print("Enter the number of lines : ");
		num = sc.nextInt();
		i = 1;
		
		min = num;
		max = num;
		while(i<=num){
			j = 1;
			cnt = i;
			while(j<=(num*2-1)){
				if(j >=min && j<=max){
					if(j<num){
						System.out.print(cnt);
						cnt--;
					}else{
						System.out.print(cnt);
						cnt++;
					}
				}else if(j==(num*2-1)){
					System.out.println(" ");
				}else{
					System.out.print(" ");
				}
				j++;
			}
			min--;
			max++;
			i++;
		}
	}

}
